<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="embed/template.xhtml">
                
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <ui:define name="topnav">
            <ui:include src="/embed/menu.xhtml">
                <ui:param name="page" value="home" />
            </ui:include>
   </ui:define> 
   
    <ui:define name="sidebar">
       <!--  <ui:include src="/login/login.xhtml" />-->
   </ui:define>
   <ui:define name="search">   
       <ui:include src="/embed/search.xhtml" />
    </ui:define>

        
        <ui:define name="body">
         <div class="productbox" >
            <h1>您的订单如下：</h1>

            <f:subview id="no_orders" rendered="#{!orders.rowAvailable}">
                <p>您还没有订购任何产品.</p>
            </f:subview>

            <f:subview id="ordersummary" rendered="#{orders.rowAvailable}">
                
            <h:dataTable value="#{orders}" var="item"
                         styleClass="dvdtable" 
                         headerClass="dvdtablehead"
                         rowClasses="dvdtableodd,dvdtableeven"
                         columnClasses="dvdtablecol">
                <h:column>
                    <f:facet name="header">订单号</f:facet>
                    #{item.orderId}
                </h:column>                        
                <h:column>
                    <f:facet name="header">订单日期</f:facet>
                    <h:outputText value="#{item.orderDate}">
                    <f:convertDateTime type="both" dateStyle="full" timeZone="GMT+8" locale="cn" />
                   　
                    </h:outputText>
                </h:column>                        
                
                 <h:column>
                    <f:facet name="header">订单状态</f:facet>
                    #{item.status}
                </h:column>        

                <h:column>
                    <s:button action="#{showorders.detailOrder}" value="详细信息显示" />
                </h:column>              
            </h:dataTable>

            <f:subview id="orderdetails" rendered="#{myorder != null}">
                <div class="cntInfo">
                    <h2>订单详情如下:</h2>

                    <h:panelGrid columns="2">
                        <h:outputText value="订单号:" />
                        <h:outputText value="#{myorder.orderId}" />

					<h:outputText value="订单日期:" />
					<h:outputText value="#{myorder.orderDate}">
						<f:convertDateTime type="both" dateStyle="full" timeZone="GMT+8" locale="cn" />
					</h:outputText>

					<h:outputText value="总价钱:" />
                        <h:outputText value="#{myorder.totalprice}">
                            <f:convertNumber type="currency" currencySymbol="￥" />
                        </h:outputText>                    
                    </h:panelGrid>
                    

                    <div class="cntInfo">
                        <h:dataTable value="#{myorder.orderitems}" var="item"
                                     styleClass="dvdtable" 
                                     headerClass="dvdtablehead"
                                     rowClasses="dvdtableodd,dvdtableeven"
                                     columnClasses="dvdtablecol">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartPriceColumn}" />
                            </f:facet>
                            <h:outputText value="#{item.product.price}">
                                <f:convertNumber type="currency" currencySymbol="￥" />
                            </h:outputText>
                        </h:column> 
                        
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartColorColumn}" />
                            </f:facet>
                            <h:outputText value="#{item.product.color}" />
                        </h:column>    
                         
                          <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartSizeColumn}" />
                            </f:facet>
                            <h:outputText value="#{item.product.size}" />
                        </h:column>    
                                               
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{messages.cartQuantityColumn}" />
                            </f:facet>
                            <h:outputText value="#{item.itemNumber}" />
                        </h:column>                        
                    </h:dataTable>
                    </div>
                </div>
            </f:subview>
        </f:subview>
         </div>
        </ui:define>
    </ui:composition>





